//
// Created by Castle-Moriarty on 2025/11/5.
//

#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main() {
    // 读取文件

    // 1 按行读取
    fstream inputFile("a.txt",ios::in);
    string line;
    while (getline(inputFile,line)) {
        cout << line << endl;
    }

    // 2 按单词读
    string word;
    while (inputFile >> word) {
        cout << word << endl;
    }

    // 3

    // 4

    inputFile.close();


    return 0;
}